package com.util;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by xudi on 2/9/16.
 */
public class JdbcTemplatePostgisImpl{

    private JdbcTemplate jdbcTemplate=new JdbcTemplate();

    public Object executeQuery(final String sql) {
        return jdbcTemplate.execute(stmt -> {
            ResultSet rs = stmt.executeQuery(sql);
            List<Object> list = new ArrayList<>();
            Object obj = null;
            while (rs.next()) {
                obj = new Object();
                list.add(obj);
            }
            return list;
        });
    }

    public Integer executeUpdate(final String sql) {
        return (Integer) jdbcTemplate.execute(stmt -> stmt.executeUpdate(sql));
    }
}
